﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Solution165
{
    public int CompareVersion1(string version1, string version2)
    {

        string[] tokens1 = version1.Split('.');
        string[] tokens2 = version2.Split('.');

        int minLen=Math.Min(tokens1.Length, tokens2.Length);
        for (int i = 0; i < minLen; i++)
        {
            int bigger = CompareNum(tokens1[i], tokens2[i]);
            if (bigger != 0)
            {
                return bigger;
            }

        }
        //前面的都一样
        //谁长谁大
        if(tokens1.Length> tokens2.Length)
        {

            return 1;
        }
        else if (tokens1.Length < tokens2.Length)
        {
            return -1;
        }





        return 0;



    }

    private int CompareNum(string v1, string v2)
    {

        int int1 = StrT0Num(v1);
        int int2 = StrT0Num(v2);


        if (int1 > int2)
        {
            return 1;
        }
        else if (int1 < int2)
        {
            return -1;
        }
        else
        {
            return 0;
        }


    }

    private int StrT0Num(string v)
    {
        int i = 0;
        int res = 0;
        while (i < v.Length && v[i] == '0')
        {


            i++;

        }

        while (i < v.Length)
        {


            int cur = v[i] - '0';
            res = res * 10 + cur;
            i++;


        }
        return res;


    }

    public int CompareVersion(string version1, string version2)
    {

        string[] tokens1 = version1.Split('.');
        string[] tokens2 = version2.Split('.');

        int i = 0;
        while (i< tokens1.Length|| i < tokens2.Length)
        {
            int x = 0, y = 0;//版本号不存在某个下标处的修订号，则该修订号视为 0。

            if(i<tokens1.Length)
            {
                x = int.Parse(tokens1[i]);
            }
            if (i < tokens2.Length)
            {
                y = int.Parse(tokens2[i]);
            }

            if(x>y) { 
            
            
            return 1;}

            if (x < y)
            {


                return -1;
            }
            i++;

        }







        return 0;



    }
}

class Program165
{


    static void Main165(string[] args)
    {
        Solution165 solution = new Solution165();
        string version1 = "1.2";
        string version2 = "1.10";
        int res = solution.CompareVersion(version1, version2);
        Console.WriteLine(res);



    }
}